﻿using System;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TestUi
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public async Task test()
        {
            Console.WriteLine("1");
            Thread.Sleep(1000);
            Console.WriteLine("2");
            await Task.Run(() =>
            {
                Console.WriteLine("3");
                Thread.Sleep(1000);
            });
        }
        public MainWindow()
        {
            InitializeComponent();
            t();

        }

        public async void t()
        {
            await test();
            Console.WriteLine("4");
        }
    }
}